package com.allqj.sfx.infrastructure.converter;

import com.allqj.sfx.domain.entity.TableHeader;
import com.allqj.sfx.infrastructure.dao.TableHeaderDAO;
import com.allqj.sfx.infrastructure.po.TableHeaderDO;
import org.springframework.beans.BeanUtils;

/**
 * @author sjw
 * @className TableHeaderConverter
 * @date 2022/7/21 9:30
 * @description: TableHeader&TableHeaderDO转换器
 */
public class TableHeaderConverter implements DataConverter<TableHeader, TableHeaderDO, TableHeaderDAO> {

    // 转换器实例
    public static TableHeaderConverter INSTANCE = new TableHeaderConverter();

    @Override
    public TableHeader do2Entity(TableHeaderDO tableHeaderDO) {
        if (tableHeaderDO == null)
            return null;
        TableHeader tableHeader = new TableHeader();
        BeanUtils.copyProperties(tableHeaderDO, tableHeader);
        return tableHeader;
    }

    @Override
    public TableHeaderDO entity2Do(TableHeader tableHeader) {
        return null;
    }

    @Override
    public TableHeaderDO entity2Do(TableHeader tableHeader, TableHeaderDAO tableHeaderDAO) {
        return null;
    }
}
